<?php

/**
* @Author:  	Daniel Dinh
* @Email:   	webdevelopmentvn@gmail.com
* @Link: 		http://joomsoft.net
* @Version: 	1.0
* @copyright:	Joomsoft.net
* @license:		GNU GPL v3
*/


defined('_JEXEC') or die;

class shoppingHelper
{

	public static function addSubmenu($vName)
	{
		JSubMenuHelper::addEntry(
			JText::_('COM_SHOPPING_SUBMENU_SHOPPING'),
			'index.php?option=com_shopping&view=shopping',
			$vName == 'shopping'
		);
	
		JSubMenuHelper::addEntry(
			JText::_("COM_SHOPPING_SUBMENU_PRODUCTS"),
			"index.php?option=com_shopping&view=products",
			$vName == "products"
		);
		JSubMenuHelper::addEntry(
			JText::_("COM_SHOPPING_SUBMENU_STATISTICS"),
			"index.php?option=com_shopping&view=statistics",
			$vName == "statistics"
		);
		JSubMenuHelper::addEntry(
			JText::_("COM_SHOPPING_SUBMENU_SETTINGS"),
			"index.php?option=com_shopping&view=settings",
			$vName == "settings"
		);
	}
	/**
	 * Gets a list of the actions that can be performed.
	 * @return	JObject
	 * @since	1.6
	 */

	public static function getActions()
	{
		$user	= JFactory::getUser();
		$result	= new JObject;
		$assetName = 'com_shopping';
		$actions = array(
			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete'
		);
		foreach ($actions as $action) {
			$result->set($action,	$user->authorise($action, $assetName));

		}
		return $result;

	}
	function quickIconButton( $link, $image, $text ) {
		
		$lang	= &JFactory::getLanguage();
		$button = '';
		$button .= '<div class="icon-wrapper">';
		$button .=	'<div class="icon">'
				   .'<a href="'.$link.'">'
				   .JHTML::_('image', 'administrator/components/com_shopping/assets/images/'.$image, $text )
				   .'<span>'.$text.'</span></a>'
				   .'</div>';
		$button .= '</div>';
		return $button;
	}

}

